<?php

use think\facade\Route;

//【通用】验证码图片
Route::get('app_admin/common/captcha', 'admin.Common/getCaptcha');
//【账号】登录
Route::post('app_admin/account/login', 'admin.AuthUser/onLogin');

Route::group('app_admin/', function () {
    //【账号】退出登录
    Route::post('account/logout', 'AuthUser/onLogout');
    //【账号】修改密码
    Route::post('account/editpwd', 'AuthUser/onEditpwd');
    //【账号】刷新token
    Route::post('account/token', 'AuthUser/onToken');
    //【账号】用户信息
    Route::get('account/profile', 'AuthUser/getProfile');

    //【缓存】重新生成
    Route::post('caches/reset', 'Caches/onReset');

    //【工作台】
    Route::get('dashboard/statistics', 'Dashboard/getStatistics');
    Route::get('dashboard/basic', 'Dashboard/getBasic');
    Route::get('dashboard/agencyRank', 'Dashboard/getAgencyRank');
    Route::get('dashboard/storeWarn', 'Dashboard/getStoreWarn');
    Route::get('dashboard/getOrder', 'Dashboard/getOrder');

    //【统计分析-用户分析】
    Route::get('analysis/user/realtime', 'Analysis/getUserRealtime');
    Route::get('analysis/user/history', 'Analysis/getUserHistory');
    Route::get('analysis/user/compare', 'Analysis/getUserCompare');
    Route::get('analysis/user/share', 'Analysis/getUserShare');
    Route::get('analysis/user/area', 'Analysis/getUserArea');
    Route::get('analysis/user/terminal', 'Analysis/getUserTerminal');
    Route::get('analysis/user/network', 'Analysis/getUserNetwork');
    Route::get('analysis/user/period', 'Analysis/getUserPeriod');
    Route::get('analysis/user/machine', 'Analysis/getUserMachine');
    //销售分析
    Route::get('analysis/user/sale', 'Analysis/getUserSale');
    //商品统计
    Route::get('analysis/user/goods', 'Analysis/getUserGoods');
    // 商品经营数据
    Route::get('analysis/user/order', 'Analysis/getUserOrder');

    //【Banner】
    Route::get('banner/page', 'Banner/getPage');
    Route::get('banner/page/notInId', 'Banner/getPageByNotInId');
    Route::get('banner/info', 'Banner/getInfo');
    Route::post('banner/save', 'Banner/onSave');
    Route::post('banner/delete', 'Banner/onDelete');
    Route::post('banner/status', 'Banner/onStatus');

    //【用户管理-用户列表】
    Route::get('user/page', 'User/getPage');
    Route::get('user/popPage', 'User/getPopPage');
    Route::post('user/status', 'User/onStatus');
    Route::post('user/memberStatus', 'User/onMemberStatus');
    Route::post('user/memberRemark', 'User/onMemberRemark');
    Route::get('user/clearAgency', 'User/onClearAgency');
    //清除推荐关系
    Route::post('user/clearBind', 'User/onClearBind');
    Route::post('user/setAgency', 'User/onSetAgency');
    Route::get('user/info', 'User/getInfo');
    Route::post('user/save', 'User/onSave');
    Route::post('user/delete', 'User/onDelete');
    //【用户收货地址管理】
    Route::get('user/address', 'UserAddress/getPage');
    //【代理商列表】
    Route::get('user/agency_list', 'User/getAgencyList');
    //【用户收益】
    Route::get('user/earnings', 'UserEarnings/getPage');
    Route::get('user/balanceLog', 'User/onBalanceLog');

    //【用户提现申请列表】
    Route::get('user/userExtractPage', 'User/getUserExtractPage');
    //用户提现详情
    Route::get('user/userExtractInfo', 'User/onUserExtractInfo');
    //修改用户余额
    Route::post('user/changePrice', 'User/onChangePrice');
    //【用户提现申请审核】
    Route::post('user/userExtractStatus', 'User/onUserExtractStatus');

    //【收益提现列表】
    Route::get('deposit/earnings/page', 'DepositEarnings/getPage');
    Route::post('deposit/earnings/status', 'DepositEarnings/onStatus');
    Route::get('deposit/earnings/info', 'DepositEarnings/onInfo');

    //【趣豆收益提现列表】
    Route::get('deposit/bean/page', 'DepositBean/getPage');
    Route::post('deposit/bean/status', 'DepositBean/onStatus');
    Route::get('deposit/bean/info', 'DepositBean/onInfo');


    //【用户管理-用户等级】
    Route::get('userLevel/page', 'UserLevel/getPage');
    Route::post('userLevel/save', 'UserLevel/onSave');
    Route::post('userLevel/delete', 'UserLevel/onDelete');
    Route::get('userLevel/info', 'UserLevel/getInfo');

    //【用户协议管理】
    Route::get('user/protocol/page', 'UserProtocol/getPage');
    Route::get('user/protocol/info', 'UserProtocol/getInfo');
    Route::post('user/protocol/save', 'UserProtocol/onSave');
    Route::post('user/protocol/status', 'UserProtocol/onStatus');
    Route::post('user/protocol/delete', 'UserProtocol/onDelete');

    //【用户推广申请管理】
    Route::get('user/market/page', 'UserMarket/getPage');
    Route::get('user/market/info', 'UserMarket/getInfo');
    Route::post('user/market/save', 'UserMarket/onSave');
    Route::post('user/market/delete', 'UserMarket/onDelete');

    //【用户推广申请管理】
    Route::get('user/member/page', 'UserMember/getPage');
    Route::get('user/member/info', 'UserMember/getInfo');
    Route::post('user/member/save', 'UserMember/onSave');
    Route::post('user/member/delete', 'UserMember/onDelete');


    //【商品管理】
    Route::get('goods/page', 'Goods/getPage');
    Route::get('goods/info', 'Goods/getInfo');
    Route::post('goods/status', 'Goods/onStatus');
    Route::post('goods/pt_status', 'Goods/onPtStatus');
    Route::post('goods/hot_status', 'Goods/onHotStatus');
    Route::post('goods/save', 'Goods/onSave');
    Route::post('goods/delete', 'Goods/onDelete');
    Route::get('goods/load_list', 'Goods/onLoadList');
    Route::get('goods/mod_price', 'Goods/onModPrice');
    Route::get('goods/mod_com_price', 'Goods/onModComPrice');
    Route::get('goods/mod_goods_price', 'Goods/onModGoodsPrice');
    //活动商品选择列表
    Route::get('goods/list_activity', 'Goods/onListActivity');
    Route::post('goods/add_attribute', 'Goods/onAddAttribute');
    Route::post('goods/del_attribute', 'Goods/onDelAttribute');

    //【商品库存管理】
    Route::get('goods/store/page', 'GoodsStore/getPage');
    Route::get('goods/store/list', 'GoodsStore/listPage');
    Route::get('goods/store/info', 'GoodsStore/getInfo');
    Route::post('goods/store/status', 'GoodsStore/onStatus');
    Route::post('goods/store/save', 'GoodsStore/onSave');
    Route::post('goods/store/delete', 'GoodsStore/onDelete');

    //【商品管理-发现】
    Route::get('goodsFind/page', 'GoodsFind/getPage');
    Route::get('goodsFind/info', 'GoodsFind/getInfo');
    Route::post('goodsFind/status', 'GoodsFind/onStatus');
    Route::post('goodsFind/save', 'GoodsFind/onSave');
    Route::post('goodsFind/delete', 'GoodsFind/onDelete');

    //【商品管理-商品分类】
    Route::get('goodsType/tree', 'GoodsType/getTree');
    Route::get('goodsType/all', 'GoodsType/getAll');
    Route::get('goodsType/info', 'GoodsType/getInfo');
    Route::post('goodsType/edit', 'GoodsType/onEdit');
    Route::post('goodsType/add', 'GoodsType/onAdd');
    Route::post('goodsType/delete', 'GoodsType/onDelete');
    Route::post('goodsType/status', 'GoodsType/onStatus');

    //【关键词管理】
    Route::get('keyword/page', 'Keyword/getPage');
    Route::get('keyword/info', 'Keyword/getInfo');
    Route::post('keyword/save', 'Keyword/onSave');
    Route::post('keyword/delete', 'Keyword/onDelete');

    //【商品导航分类管理】
    Route::get('navbar/page', 'GoodsNavbar/getPage');
    Route::get('navbar/info', 'GoodsNavbar/getInfo');
    Route::post('navbar/save', 'GoodsNavbar/onSave');
    Route::post('navbar/status', 'GoodsNavbar/onStatus');
    Route::post('navbar/delete', 'GoodsNavbar/onDelete');

    //【运费模板管理】
    Route::get('freight/page', 'GoodsFreight/getPage');
    Route::get('freight/info', 'GoodsFreight/getInfo');
    Route::post('freight/save', 'GoodsFreight/onSave');
    Route::post('freight/delete', 'GoodsFreight/onDelete');
    Route::post('freight/default', 'GoodsFreight/onDefault');


    //【商家管理】
    Route::get('store/page', 'Store/getPage');
    Route::get('store/all', 'Store/getAll');
    Route::get('store/info', 'Store/getInfo');
    Route::post('store/save', 'Store/onSave');
    Route::post('store/status', 'Store/onStatus');
    Route::post('store/delete', 'Store/onDelete');
    Route::post('store/checkStatus', 'Store/onCheckStatus');

    //【商家权限-菜单规则】
    Route::get('storeAuth/rule/tree', 'StoreAuthRule/getTree');
    Route::get('storeAuth/rule/info', 'StoreAuthRule/getInfo');
    Route::post('storeAuth/rule/save', 'StoreAuthRule/onSave');
    Route::post('storeAuth/rule/delete', 'StoreAuthRule/onDelete');

    //【商家权限-角色分组】
    Route::get('storeAuth/group/page', 'StoreAuthGroup/getPage');
    Route::get('storeAuth/group/info', 'StoreAuthGroup/getInfo');
    Route::get('storeAuth/group/all', 'StoreAuthGroup/getAll');
    Route::post('storeAuth/group/save', 'StoreAuthGroup/onSave');
    Route::post('storeAuth/group/delete', 'StoreAuthGroup/onDelete');
    Route::post('storeAuth/group/status', 'StoreAuthGroup/onStatus');

    //【商家权限-用户管理】
    Route::get('storeAuth/user/page', 'StoreAuthUser/getPage');
    Route::get('storeAuth/user/info', 'StoreAuthUser/getInfo');
    Route::post('storeAuth/user/save', 'StoreAuthUser/onSave');
    Route::post('storeAuth/user/delete', 'StoreAuthUser/onDelete');
    Route::post('storeAuth/user/status', 'StoreAuthUser/onStatus');
    Route::post('storeAuth/user/delcache', 'StoreAuthUser/onDelCache');

    //【图文动态】
    Route::get('content/article/page', 'ContentArticle/getPage');
    Route::get('content/article/info', 'ContentArticle/getInfo');
    Route::post('content/article/save', 'ContentArticle/onSave');
    Route::post('content/article/status', 'ContentArticle/onStatus');
    Route::post('content/article/delete', 'ContentArticle/onDelete');

    //【图文动态分类】
    Route::get('content/type/page', 'ContentType/getPage');
    Route::get('content/type/all', 'ContentType/getAll');
    Route::get('content/type/info', 'ContentType/getInfo');
    Route::post('content/type/save', 'ContentType/onSave');
    Route::post('content/type/status', 'ContentType/onStatus');
    Route::post('content/type/delete', 'ContentType/onDelete');

    //【代理商管理】
    Route::get('agency/page', 'Agency/getPage');
    Route::get('agency/info', 'Agency/getInfo');
    Route::post('agency/status', 'Agency/onStatus');
    Route::post('agency/save', 'Agency/onSave');
    Route::post('agency/delete', 'Agency/onDelete');
    Route::post('agency/editpwd', 'Agency/onEditPassword');
    Route::post('agency/address', 'Agency/getLngLat');

    //【经销商(渠道商)管理】
    Route::get('distributor/page', 'Distributor/getPage');
    Route::get('distributor/all', 'Distributor/getAll');
    Route::get('distributor/info', 'Distributor/getInfo');
    Route::post('distributor/status', 'Distributor/onStatus');
    Route::post('distributor/save', 'Distributor/onSave');
    Route::post('distributor/delete', 'Distributor/onDelete');

    //【商家认证管理】
    Route::get('business/page', 'Business/getPage');
    Route::get('business/all', 'Business/getAll');
    Route::get('business/info', 'Business/getInfo');
    Route::post('business/status', 'Business/onStatus');
    Route::post('business/save', 'Business/onSave');
    Route::post('business/delete', 'Business/onDelete');


    //【代理商管理-收益】
    Route::get('agency/earnings', 'AgencyEarnings/getPage');
    Route::get('agency/addEarnings', 'AgencyEarnings/addEarnings');
    //【代理商管理-商品】
    Route::get('agencyGoods/page', 'AgencyGoods/getPage');
    //更改代理商库存
    Route::post('agencyGoods/change', 'AgencyGoods/onChange');
    //更改代理商库存
    Route::post('agencyGoods/save', 'AgencyGoods/onSave');
    //【代理商管理-进货单】
    Route::get('agency/orderPage', 'AgencyOrder/getPage');

    //【代理商管理-进货单】
    Route::get('agency/orderInfo', 'AgencyOrder/onOrderInfo');

    //【代理商管理-进货单处理】
    Route::post('agency/orderStatus', 'AgencyOrder/onOrderStatus');

    //【代理商提现申请列表】
    Route::get('agency/agencyExtractPage', 'Agency/getAgencyExtractPage');
    //代理商提现详情
    Route::get('agency/agencyExtractInfo', 'Agency/onAgencyExtractInfo');

    //【代理商提现申请审核】
    Route::post('agency/agencyExtractStatus', 'Agency/onAgencyExtractStatus');
    Route::post('agency/agencyExtractSave', 'Agency/onAgencyExtractSave');

    //【活动(团购)管理】
    Route::get('activity/page', 'Activity/getPage');
    Route::get('activity/info', 'Activity/getInfo');
    Route::post('activity/status', 'Activity/onStatus');
    Route::post('activity/save', 'Activity/onSave');
    Route::post('activity/delete', 'Activity/onDelete');

    //【活动(团购)管理】
    Route::get('activityGoods/page', 'ActivityGoods/getPage');
    Route::get('activityGoods/info', 'ActivityGoods/getInfo');
    Route::post('activityGoods/change', 'activityGoods/onChange');
    Route::post('activityGoods/status', 'ActivityGoods/onStatus');
    Route::post('activityGoods/save', 'ActivityGoods/onSave');
    Route::post('activityGoods/delete', 'ActivityGoods/onDelete');


    //【县长推荐管理】
    Route::get('leadershipRec/page', 'LeadershipRec/getPage');
    Route::get('leadershipRec/info', 'LeadershipRec/getInfo');
    Route::post('leadershipRec/change', 'LeadershipRec/onChange');
    Route::post('leadershipRec/status', 'LeadershipRec/onStatus');
    Route::post('leadershipRec/save', 'LeadershipRec/onSave');
    Route::post('leadershipRec/delete', 'LeadershipRec/onDelete');

    //【订单管理】
    Route::get('order/page', 'Order/getPage');
    Route::get('paylog/page', 'Order/getPayPage');
    Route::get('order/info', 'Order/getInfo');
    Route::post('order/delete', 'Order/onDelete');

    Route::get('order/logisticsInfo', 'Order/getInfo');
    Route::get('order/logisticsLog', 'Order/getLogisticsLog');
    Route::post('order/saveLogistics', 'Order/onSaveLogistics');
    Route::get('order/logisticsAll', 'Order/onLogisticsAll');
    Route::post('order/getItemsInfo', 'Order/getItemsInfo');

    Route::get('order/orderOutPage', 'Order/onOutPage');
    Route::post('order/orderOutInfo', 'Order/onOutInfo');
    Route::post('order/orderOutEdit', 'Order/onOrderOutEdit');
    Route::post('order/orderOutSave', 'Order/onOrderOutSave');
    Route::get('order/confirmTake', 'Order/onConfirmTake');
    Route::get('order/cancelOrder', 'Order/onCancelOrder');
    Route::post('order/setOrderPrice', 'Order/onSetOrderPrice');
    Route::post('order/setTakeAddress', 'Order/onSetTakeAddress');
    Route::post('order/setLogisticsNumber', 'Order/onSetLogisticsNumber');
    Route::get('order/payOrder', 'Order/onPayOrder');
    //修改实际收款确收款
    Route::post('order/setPayOrder', 'Order/onSetPayOrder');
    Route::post('order/orderOutDelete', 'Order/onDelete');
    Route::get('order/exportOrder', 'Order/onExportOrder');
    Route::get('order/distributorPage', 'Order/onDistributorPage');

    //【物流管理】
    Route::get('logistics/page', 'Logistics/getPage');
    Route::get('logistics/info', 'Logistics/getInfo');
    Route::post('logistics/save', 'Logistics/onSave');
    Route::post('logistics/delete', 'Logistics/onDelete');

    //【权限-菜单规则】
    Route::get('auth/rule/tree', 'AuthRule/getTree');
    Route::get('auth/rule/info', 'AuthRule/getInfo');
    Route::post('auth/rule/save', 'AuthRule/onSave');
    Route::post('auth/rule/delete', 'AuthRule/onDelete');

    //【权限-角色分组】
    Route::get('auth/group/page', 'AuthGroup/getPage');
    Route::get('auth/group/info', 'AuthGroup/getInfo');
    Route::get('auth/group/all', 'AuthGroup/getAll');
    Route::post('auth/group/save', 'AuthGroup/onSave');
    Route::post('auth/group/delete', 'AuthGroup/onDelete');
    Route::post('auth/group/status', 'AuthGroup/onStatus');

    //【权限-用户管理】
    Route::get('auth/user/page', 'AuthUser/getPage');
    Route::get('auth/user/info', 'AuthUser/getInfo');
    Route::post('auth/user/save', 'AuthUser/onSave');
    Route::post('auth/user/delete', 'AuthUser/onDelete');
    Route::post('auth/user/status', 'AuthUser/onStatus');
    Route::post('auth/user/delcache', 'AuthUser/onDelCache');

    //【回收站】
    Route::get('recycle/page', 'SysRecycle/getPage');
    Route::post('recycle/back', 'SysRecycle/onBack');
    Route::post('recycle/del', 'SysRecycle/onDel');

    //【系统配置】
    Route::get('sys/config/info', 'SysConfig/getInfo');
    Route::post('sys/config/save', 'SysConfig/onSave');
})->prefix('admin.')->middleware(['token', 'auth']);
